package com.yunshang.shoppingmall.service.impl;

import com.yunshang.shoppingmall.entity.Classify;
import com.yunshang.shoppingmall.mapper.ClassifyMapper;
import com.yunshang.shoppingmall.service.ClassifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("ClassifyService")
public class ClassifyServiceImpl implements ClassifyService {
    @Autowired
    ClassifyMapper classifyMapper;

    @Override
    public int deleteByPrimaryKey(Integer classId) {
return classifyMapper.deleteByPrimaryKey(classId);
    }

    @Override
    public int insert(Classify record) {
        return classifyMapper.insert(record);
    }

    @Override
    public int insertSelective(Classify record) {
        return 0;
    }

    @Override
    public Classify selectByPrimaryKey(Integer classId) {
        return classifyMapper.selectByPrimaryKey(classId);
    }

    @Override
    public int updateByPrimaryKeySelective(Classify record) {
        return classifyMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Classify record) {
        return classifyMapper.updateByPrimaryKey(record);
    }

    @Override
    public int updateUpperRankId(Integer classId, Integer upperRankId) {
        return  classifyMapper.updateUpperRankId(classId,upperRankId);
    }

    @Override
    public List<Classify> selectList(int upperRankId) {
        return classifyMapper.selectList(upperRankId);
    }

    @Override
    public List<Classify> selectListAll() {
       return classifyMapper.selectListAll();
    }

    /**
     * 查询分类的一级分类
     * @return
     */
    @Override
    public List<Classify> selectYJClassify() {
        return classifyMapper.selectYJClassify();
    }

    /**
     * 查询二级分类
     * @param classId
     * @return
     */
    @Override
    public List<Classify> selectRJClassify(int classId) {
        return classifyMapper.selectRJClassify(classId);
    }


//    @Override
//    public List<Classify> selectSJClassify(int classId) {
//        return classifyMapper.selectSJClassify(classId);
//    }

    @Override
    public List<Classify> selectProductYJAndRjClassfy() {
        return classifyMapper.selectProductYJAndRjClassfy();
    }

    @Override
    public List<Classify> selectProductSJClassfy() {
        return classifyMapper.selectProductSJClassfy();
    }


}
